import { ColumnGroupType, ColumnType } from "antd/es/table"

import TooltipText from "@/components/common/tooltipText"

export const memberInfoChangeRecordSetupColumns = (
	newFormat: (p: { id: string } | string) => string,
	_getFromDic: (arg: string, strictlyLabel?: boolean) => any
): Record<string, ColumnGroupType<any> | ColumnType<any>> => ({
	memberInfoChangeRecord_operationTarget: {
		key: "operationTarget",
		dataIndex: "operationTarget",
		title: newFormat("common.member_number"),
		align: "center",
		width: 120
	},
	memberInfoChangeRecord_operatorType: {
		key: "operatorType",
		dataIndex: "operatorType",
		title: newFormat("common.account_type"),
		align: "center",
		width: 120
	},
	memberInfoChangeRecord_operationFunc: {
		key: "operationFunc",
		dataIndex: "operationFunc",
		title: newFormat("member.change_type"),
		align: "center",
		width: 120
	},
	memberInfoChangeRecord_beforeModify: {
		key: "beforeModify",
		dataIndex: "beforeModify",
		title: newFormat("member.information_before_change"),
		align: "center",
		width: 120,
		render: (text: string) => <TooltipText text={text} />
	},
	memberInfoChangeRecord_afterModify: {
		key: "afterModify",
		dataIndex: "afterModify",
		title: newFormat("member.information_after_change"),
		align: "center",
		width: 120,
		render: (text: string) => <TooltipText text={text} />
	},
	memberInfoChangeRecord_remark: {
		key: "remark",
		dataIndex: "remark",
		title: newFormat("common.remarks"),
		align: "center",
		width: 120
	}
})
